<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath %>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登录界面</title>
<link rel="stylesheet" type="text/css" href="js/util/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="js/util/easyui/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="js/util/easyui/demo/demo.css">
<script type="text/javascript" src="js/util/jquery/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="js/util/easyui/jquery.easyui.min.js"></script>

 
 <script type="text/javascript">
    function reloadCode(){
	var time=new Date().getTime();
	document.getElementById("imagecode").src="<%= request.getContextPath()%>/ImageServlet?d="+time;
    }
	</script>
</head>
<body>

<h1 >用户登录</h1>
	<div style="margin:20px 0;"></div>
	<div class="easyui-panel" title style="width:400px" >
		<div style="padding:10px 30px 10px 10px">
	    <form  id="iform" method="post" action="UserLoginServlet">
	    	<table cellpadding="5">
	    		<tr>
	    			<td>用户名:</td>
	    			<td><input class="easyui-textbox" type="text" name="username" data-options="required:true"></input></td>
	    		</tr>
	    		<tr>
	    			<td>密码:</td>
	    			<td><input class="easyui-passwordbox" id="password" name="password" data-options="required:true"></input></td>
	    		</tr>
	    		<tr>
	    			<td>验证码:</td>
	    			<td><input class="easyui-textbox" type="text" name="checkCode" data-options="required:true"></td>
	    		</tr>
	    		<tr>
	    		<td></td><td><img alt="验证码" id="imagecode" src="<%= request.getContextPath()%>/ImageServlet"/></td>
            <td> <a href="javascript:reloadCode();">看不清楚</a></td></tr>
            <tr>
            <td></td>
            <td>
            <input type="submit" value="登录"></td> <td><input type="button" value="注册"  onclick="reg()">
            </td></tr>
	    	</table>
	    </form>   
            
           



<script>
function reg(){
	var form = document.getElementById("iform");
	form.action ="user/UserRegistration.jsp";
	form.submit();
}
</script>
</body>
</html>